
package com.shangsi.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author dzd
 * @date 2021-12-16
 */
@RestController
public class PaymentController {

    @Value("${server.port}")
    private String serverPort;

    @RequestMapping("payment/{id}")
    public String getPayment(@PathVariable("id") Integer id){
        if (id==4){
            throw new IllegalArgumentException("非法参数异常");
        }else if (id==0){
            throw new NullPointerException("空指针");
        }
        return "nacos regisry,serverPort: "+serverPort+ " ,id:"+id;

    }
}
